package com.hzky.demo.dao;

import com.hzky.demo.model.Homework;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by admin on 2017/6/8.
 */
public interface HomeworkDao extends JpaRepository<Homework,Integer> {

    @Query(value = "select c.* from child_english.dbo.teacher_student a,child_english.dbo.course b,child_english.dbo.homework c where c.course_id=b.id and b.t_phone=a.t_phone and a.student_id=:studentId",nativeQuery = true)
    List<Homework> getHomeworkByStudentId(@Param("studentId")Integer studentId);
}
